package org.alwayssuper.protocol.commons.transform;

import org.alwayssuper.protostar.PrepareLoadStrategy;
import org.alwayssuper.protostar.schema.MultiMapSchema;
import org.alwayssuper.protostar.schema.NumberSchema;
import org.alwayssuper.protocol.commons.transform.realtimev2016.*;

/**
 * 2016版实时消息上报转化器
 * 基于GB/T 32960.3-2016标准和AICoding报文规则文档
 * 适用于key后面直接跟value对象的GBT32960协议格式
 * @author alwaysSuper
 */
public class RealTimeConverterV2016 extends MultiMapSchema<Number, Object> {
    public RealTimeConverterV2016() {
        super(NumberSchema.BYTE_INT);
    }

    @Override
    protected void addSchemas(PrepareLoadStrategy<Number> schemaRegistry) {
        schemaRegistry
                // 基础数据类型 (按标准表8顺序)
                .addSchema(RealTimeTypeV2016.整车数据, Vehicle.class)
                .addSchema(RealTimeTypeV2016.驱动电机数据, DriveMotor.class)
                .addSchema(RealTimeTypeV2016.燃料电池数据, FuelCellData.class)  // 新增
                .addSchema(RealTimeTypeV2016.发动机数据, EngineData.class)      // 新增
                .addSchema(RealTimeTypeV2016.车辆位置数据, VehiclePosition.class)
                .addSchema(RealTimeTypeV2016.极值数据, ExtremeData.class)
                .addSchema(RealTimeTypeV2016.报警数据, AlarmData.class)
                .addSchema(RealTimeTypeV2016.可充电储能装置电压数据, BatteryVoltageData.class)  // 新增0x08
                .addSchema(RealTimeTypeV2016.可充电储能装置温度数据, BatteryTemperatureData.class); // 新增0x09
    }
}
